package com.vimi8.ebb.api.datareport;

import com.vimi8.ebb.configuration.HttpResponseEntity;
import com.vimi8.ebb.model.DataReport;
import com.vimi8.ebb.model.Paginator;
import com.vimi8.ebb.param.DataReportQueryParam;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 数据报告api
 * Created by xiehuang on 2017/1/19.
 */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-09-12T05:46:07.581Z")
@RestController
@Api(value = "datareport", description = "the datareport API")
public interface DataReportApi {
    @ApiOperation(value = "查询数据报告", notes = "查询数据报告.", response = DataReport.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回数据报告列表", response = DataReport.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/datareport/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<DataReport>>> getDataReports(
            DataReportQueryParam param
    );

    @ApiOperation(value = "根据ID查询数据报告", notes = "根据ID查询数据报告.", response = DataReport.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回数据报告", response = DataReport.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/datareport/{id}",
            method = RequestMethod.GET)
    HttpResponseEntity<DataReport> getDataReportById(
            @ApiParam(value = "id", required = true) @PathVariable(value = "id", required = true) String id
    );

    @ApiOperation(value = "添加数据报告", notes = "添加数据报告.", response = String.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/datareport/",
            method = RequestMethod.POST)
    HttpResponseEntity<String> addDataReport(
            @ApiParam(value = "数据报告", required = true) @RequestBody DataReport dataReport
    );

    @ApiOperation(value = "修改数据报告", notes = "修改数据报告.", response = String.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/datareport/",
            method = RequestMethod.PUT)
    HttpResponseEntity<String> updateDataReport(
            @ApiParam(value = "数据报告", required = true) @RequestBody DataReport dataReport
    );

    @ApiOperation(value = "删除数据报告", notes = "删除数据报告.", response = String.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回影响行数", response = String.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/datareport/",
            method = RequestMethod.DELETE)
    HttpResponseEntity<String> deleteDataReport(
            @ApiParam(value = "数据报告id", required = true) @RequestParam(value = "id", required = true) String id
    );

}
